package com.wzcl.app.dao.model;


import com.wzcl.app.dao.model.common.Base;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.util.List;

@Data
@Entity
@Table(name = "ActivityRule",
        uniqueConstraints = {
                @UniqueConstraint(columnNames = {"activityId", "orderNo"})
        }
)
@ApiModel(value = "活动表匹配的规则")
public class ActivityRule implements Base {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @ApiModelProperty(value = "活动Id")
    private Integer activityId;

    @ApiModelProperty(value = "作用对象")
    private Integer target;

    @ApiModelProperty(value = "用户组Id")
    private Integer groupId;

    @ApiModelProperty(value = "优先级")
    private Integer orderNo;

    @OneToMany(cascade = CascadeType.REMOVE, mappedBy = "activityRule")
    @ApiModelProperty(value = "参数")
    private List<ActivityRuleInfo> ruleInfoList;
}
